package com.gitee.sparta.core.cluster.strategy;

import com.gitee.sparta.core.bean.cluster.ClusterProtocol;
import com.gitee.sparta.core.cluster.balance.LoadBalance;
import com.gitee.sparta.core.property.SpartaCoreProperties;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RedissonClient;

import java.nio.channels.SocketChannel;

/**
 * <p>
 *      心跳
 * </p>
 *
 * @author zyred
 * @since v 0.0.2
 */
@Slf4j
public class HeartbeatStrategy extends Strategy {

    public HeartbeatStrategy(RedissonClient client,
                             LoadBalance loadBalance,
                             SpartaCoreProperties properties) {
        super(client, loadBalance, properties);
    }

    @Override
    public void handle(ChannelHandlerContext ctx, SocketChannel sc, ClusterProtocol cp) {
        ctx.fireChannelRead(cp);
    }
}
